import React, { useState, useEffect, useReducer } from 'react'
import { View, Text, TextInput, Button, StyleSheet, Image, TouchableOpacity, Alert,ScrollView } from 'react-native'
import { connect } from 'react-redux'

import axios from 'axios'//当页面有第二个get/post/put/delete方法时，直接使用axios调用

import stateToProps from '../store/stateToProps'//变量
import dispatchToProps from '../store/dispatchToProps'//方法
import Icon from 'react-native-vector-icons/AntDesign';

const Set = (props) => {
    let { inputValue, inputChange, inputValue1, inputChange1, clickBtn, postFun, deleteFun, getFun, putFun,
        list, list1, data, post, } = props
    /*这里是页面加载完成时调用，会调用get请求，拉取数据*/
    // useEffect(() => {
    //     getFun()
    // })
    return (
        <ScrollView style={{ backgroundColor: '#F5F5F5'}}>
            <View style={styles.top}>
            <Icon name="left" size={30} color='black' style={{marginTop:10,marginLeft:ptd(15)}} onPress={()=>{ props.navigation.push('Mine') }}></Icon>
                <Text style={styles.title}>设置</Text>
            </View>
            <View style={styles.list}>
                <TouchableOpacity style={styles.lists}><Text style={styles.name}>意见反馈</Text><Text style={styles.jiantou}>></Text></TouchableOpacity>
                <TouchableOpacity style={styles.lists}><Text style={styles.name}>关于我们</Text><Text style={styles.jiantou}>></Text></TouchableOpacity>
                {/* 跳转换成登陆页面 */}
                <TouchableOpacity style={styles.lists} onPress={()=>{ props.navigation.push('Mine') }}><Text style={styles.name}>退出登录</Text><Text style={styles.jiantou}>></Text></TouchableOpacity>
            </View>
            
        </ScrollView>
    )
}

const styles = StyleSheet.create({
    jiantou:{
        position:'absolute',
        paddingLeft:ptd(300),
        fontSize:25
    },
    list:{
        width:'90%',
        height:400,
        marginTop:70
    },
    name:{
        fontSize:18,

    },
    lists:{
        justifyContent:'center',
        height:50,
        width:ptd(330),
        marginLeft:ptd(20),
    },
    title: {
        fontSize: 20,
        position: 'absolute',
        top: ptd(7),
        left: ptd(160)
    },
    back: {
        paddingLeft: ptd(10),
        marginTop: ptd(10),
    },
    top: {
        position: 'absolute',
        width: '100%',
        height: 50,
        backgroundColor: '#F8F8F8',
        borderColor: '#F8F8F8',
        borderWidth: 2
    }
});
//每个自己写的组件（页面）都要用下面这一行
export default connect(stateToProps, dispatchToProps)(Set);
